Optimal. Leaf size=157 \[ -\frac {4 (3 A+5 i B) c^4 x}{a}-\frac {4 (3 i A-5 B) c^4 \log (\cos (e+f x))}{a f}-\frac {8 (A+i B) c^4}{a f (i-\tan (e+f x))}+\frac {(5 A+12 i B) c^4 \tan (e+f x)}{a f}-\frac {(i A-5 B) c^4 \tan ^2(e+f x)}{2 a f}-\frac {i B c^4 \tan ^3(e+f x)}{3 a f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 157, normalized size of antiderivative = 1.00, number of steps
used = 3, number of rules used = 2, integrand size = 41, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.049, Rules used = {3669, 78}
\begin {gather*} -\frac {c^4 (-5 B+i A) \tan ^2(e+f x)}{2 a f}+\frac {c^4 (5 A+12 i B) \tan (e+f x)}{a f}-\frac {8 c^4 (A+i B)}{a f (-\tan (e+f x)+i)}-\frac {4 c^4 (-5 B+3 i A) \log (\cos (e+f x))}{a f}-\frac {4 c^4 x (3 A+5 i B)}{a}-\frac {i B c^4 \tan ^3(e+f x)}{3 a f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 78
Rule 3669
Rubi steps
\begin {align*} \int \frac {(A+B \tan (e+f x)) (c-i c \tan (e+f x))^4}{a+i a \tan (e+f x)} \, dx &=\frac {(a c) \text {Subst}\left (\int \frac {(A+B x) (c-i c x)^3}{(a+i a x)^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {(a c) \text {Subst}\left (\int \left (\frac {(5 A+12 i B) c^3}{a^2}+\frac {(-i A+5 B) c^3 x}{a^2}-\frac {i B c^3 x^2}{a^2}-\frac {8 (A+i B) c^3}{a^2 (-i+x)^2}+\frac {4 i (3 A+5 i B) c^3}{a^2 (-i+x)}\right ) \, dx,x,\tan (e+f x)\right )}{f}\\ &=-\frac {4 (3 A+5 i B) c^4 x}{a}-\frac {4 (3 i A-5 B) c^4 \log (\cos (e+f x))}{a f}-\frac {8 (A+i B) c^4}{a f (i-\tan (e+f x))}+\frac {(5 A+12 i B) c^4 \tan (e+f x)}{a f}-\frac {(i A-5 B) c^4 \tan ^2(e+f x)}{2 a f}-\frac {i B c^4 \tan ^3(e+f x)}{3 a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.60, size = 260, normalized size = 1.66 \begin {gather*} \frac {c^4 (\cos (f x)+i \sin (f x)) \left (12 (-3 i A+5 B) \log \left (\cos ^2(e+f x)\right ) \left (\cos \left (\frac {e}{2}\right )+i \sin \left (\frac {e}{2}\right )\right )^2-24 (3 A+5 i B) \text {ArcTan}(\tan (f x)) (\cos (e)+i \sin (e))+24 (A+i B) \cos (2 f x) (i \cos (e)+\sin (e))+24 (A+i B) (\cos (e)-i \sin (e)) \sin (2 f x)+2 (15 A+37 i B) \sec (e+f x) \sin (f x) (1+i \tan (e))+2 B \sec ^3(e+f x) \sin (f x) (-i+\tan (e))+\cos (e) \sec ^2(e+f x) (-i+\tan (e)) (3 (A+5 i B)+2 B \tan (e))\right ) (A+B \tan (e+f x))}{6 f (A \cos (e+f x)+B \sin (e+f x)) (a+i a \tan (e+f x))} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.22, size = 106, normalized size = 0.68
method | result | size |
derivativedivides | \(\frac {c^{4} \left (\frac {5 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+5 A \tan \left (f x +e \right )-\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}+12 i B \tan \left (f x +e \right )-\frac {-8 i B -8 A}{-i+\tan \left (f x +e \right )}+\left (12 i A -20 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )\right )}{f a}\) | \(106\) |
default | \(\frac {c^{4} \left (\frac {5 B \left (\tan ^{2}\left (f x +e \right )\right )}{2}-\frac {i B \left (\tan ^{3}\left (f x +e \right )\right )}{3}+5 A \tan \left (f x +e \right )-\frac {i A \left (\tan ^{2}\left (f x +e \right )\right )}{2}+12 i B \tan \left (f x +e \right )-\frac {-8 i B -8 A}{-i+\tan \left (f x +e \right )}+\left (12 i A -20 B \right ) \ln \left (-i+\tan \left (f x +e \right )\right )\right )}{f a}\) | \(106\) |
risch | \(-\frac {4 c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} B}{a f}+\frac {4 i c^{4} {\mathrm e}^{-2 i \left (f x +e \right )} A}{a f}-\frac {40 i c^{4} B x}{a}-\frac {24 c^{4} A x}{a}-\frac {40 i c^{4} B e}{f a}-\frac {24 c^{4} A e}{f a}-\frac {2 c^{4} \left (-12 i A \,{\mathrm e}^{4 i \left (f x +e \right )}+24 B \,{\mathrm e}^{4 i \left (f x +e \right )}-27 i A \,{\mathrm e}^{2 i \left (f x +e \right )}+57 B \,{\mathrm e}^{2 i \left (f x +e \right )}-15 i A +37 B \right )}{3 f a \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{3}}+\frac {20 c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) B}{f a}-\frac {12 i c^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) A}{f a}\) | \(224\) |
norman | \(\frac {\frac {\left (20 i c^{4} B +13 A \,c^{4}\right ) \tan \left (f x +e \right )}{a f}-\frac {4 \left (5 i c^{4} B +3 A \,c^{4}\right ) x}{a}-\frac {-17 i c^{4} A +21 B \,c^{4}}{2 a f}+\frac {5 \left (7 i c^{4} B +3 A \,c^{4}\right ) \left (\tan ^{3}\left (f x +e \right )\right )}{3 a f}-\frac {4 \left (5 i c^{4} B +3 A \,c^{4}\right ) x \left (\tan ^{2}\left (f x +e \right )\right )}{a}+\frac {\left (-i c^{4} A +5 B \,c^{4}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{2 a f}-\frac {i c^{4} B \left (\tan ^{5}\left (f x +e \right )\right )}{3 a f}}{1+\tan ^{2}\left (f x +e \right )}-\frac {2 \left (-3 i c^{4} A +5 B \,c^{4}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{a f}\) | \(227\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F(-2)]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Exception raised: RuntimeError} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 311 vs. \(2 (142) = 284\).
time = 2.83, size = 311, normalized size = 1.98 \begin {gather*} -\frac {2 \, {\left (12 \, {\left (3 \, A + 5 i \, B\right )} c^{4} f x e^{\left (8 i \, f x + 8 i \, e\right )} + 6 \, {\left (-i \, A + B\right )} c^{4} + 6 \, {\left (6 \, {\left (3 \, A + 5 i \, B\right )} c^{4} f x + {\left (-3 i \, A + 5 \, B\right )} c^{4}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (12 \, {\left (3 \, A + 5 i \, B\right )} c^{4} f x + 5 \, {\left (-3 i \, A + 5 \, B\right )} c^{4}\right )} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (12 \, {\left (3 \, A + 5 i \, B\right )} c^{4} f x + 11 \, {\left (-3 i \, A + 5 \, B\right )} c^{4}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + 6 \, {\left ({\left (3 i \, A - 5 \, B\right )} c^{4} e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, {\left (3 i \, A - 5 \, B\right )} c^{4} e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, {\left (3 i \, A - 5 \, B\right )} c^{4} e^{\left (4 i \, f x + 4 i \, e\right )} + {\left (3 i \, A - 5 \, B\right )} c^{4} e^{\left (2 i \, f x + 2 i \, e\right )}\right )} \log \left (e^{\left (2 i \, f x + 2 i \, e\right )} + 1\right )\right )}}{3 \, {\left (a f e^{\left (8 i \, f x + 8 i \, e\right )} + 3 \, a f e^{\left (6 i \, f x + 6 i \, e\right )} + 3 \, a f e^{\left (4 i \, f x + 4 i \, e\right )} + a f e^{\left (2 i \, f x + 2 i \, e\right )}\right )}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [A]
time = 0.57, size = 328, normalized size = 2.09 \begin {gather*} \frac {30 i A c^{4} - 74 B c^{4} + \left (54 i A c^{4} e^{2 i e} - 114 B c^{4} e^{2 i e}\right ) e^{2 i f x} + \left (24 i A c^{4} e^{4 i e} - 48 B c^{4} e^{4 i e}\right ) e^{4 i f x}}{3 a f e^{6 i e} e^{6 i f x} + 9 a f e^{4 i e} e^{4 i f x} + 9 a f e^{2 i e} e^{2 i f x} + 3 a f} + \begin {cases} \frac {\left (4 i A c^{4} - 4 B c^{4}\right ) e^{- 2 i e} e^{- 2 i f x}}{a f} & \text {for}\: a f e^{2 i e} \neq 0 \\x \left (- \frac {- 24 A c^{4} - 40 i B c^{4}}{a} + \frac {\left (- 24 A c^{4} e^{2 i e} + 8 A c^{4} - 40 i B c^{4} e^{2 i e} + 8 i B c^{4}\right ) e^{- 2 i e}}{a}\right ) & \text {otherwise} \end {cases} - \frac {4 i c^{4} \cdot \left (3 A + 5 i B\right ) \log {\left (e^{2 i f x} + e^{- 2 i e} \right )}}{a f} + \frac {x \left (- 24 A c^{4} - 40 i B c^{4}\right )}{a} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 445 vs. \(2 (142) = 284\).
time = 0.83, size = 445, normalized size = 2.83 \begin {gather*} \frac {2 \, {\left (\frac {6 \, {\left (-3 i \, A c^{4} + 5 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 1\right )}{a} - \frac {12 \, {\left (-3 i \, A c^{4} + 5 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}{a} - \frac {6 \, {\left (3 i \, A c^{4} - 5 \, B c^{4}\right )} \log \left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 1\right )}{a} - \frac {6 \, {\left (9 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 15 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 22 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 34 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - 9 i \, A c^{4} + 15 \, B c^{4}\right )}}{a {\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) - i\right )}^{2}} - \frac {-33 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 55 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{6} + 15 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 36 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{5} + 102 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 180 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{4} - 30 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 76 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{3} - 102 i \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 180 \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} + 15 \, A c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 36 i \, B c^{4} \tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right ) + 33 i \, A c^{4} - 55 \, B c^{4}}{{\left (\tan \left (\frac {1}{2} \, f x + \frac {1}{2} \, e\right )^{2} - 1\right )}^{3} a}\right )}}{3 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 8.80, size = 205, normalized size = 1.31 \begin {gather*} \frac {\ln \left (\mathrm {tan}\left (e+f\,x\right )-\mathrm {i}\right )\,\left (-\frac {20\,B\,c^4}{a}+\frac {A\,c^4\,12{}\mathrm {i}}{a}\right )}{f}-\frac {{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (-\frac {B\,c^4}{a}+\frac {c^4\,\left (A+B\,3{}\mathrm {i}\right )\,1{}\mathrm {i}}{2\,a}\right )}{f}-\frac {\frac {\left (4\,A\,c^4+B\,c^4\,12{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}-\frac {\left (12\,A\,c^4+B\,c^4\,20{}\mathrm {i}\right )\,1{}\mathrm {i}}{a}}{f\,\left (1+\mathrm {tan}\left (e+f\,x\right )\,1{}\mathrm {i}\right )}+\frac {\mathrm {tan}\left (e+f\,x\right )\,\left (\frac {2\,c^4\,\left (A+B\,3{}\mathrm {i}\right )}{a}+\frac {B\,c^4\,3{}\mathrm {i}}{a}-\frac {c^4\,\left (-B+A\,1{}\mathrm {i}\right )\,3{}\mathrm {i}}{a}\right )}{f}-\frac {B\,c^4\,{\mathrm {tan}\left (e+f\,x\right )}^3\,1{}\mathrm {i}}{3\,a\,f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________